home *** CD-ROM | disk | FTP | other *** search
/ Tech Arsenal 1 / Tech Arsenal (Arsenal Computer).ISO / tek-19 / iritsm3s.zip / GEOMAT3D.H < prev    next >
C/C++ Source or Header  |  1991-10-26  |  3KB  |  74 lines

  1. /*****************************************************************************
  2. *   "Irit" - the 3d polygonal solid modeller.                     *
  3. *                                         *
  4. * Written by:  Gershon Elber                Ver 0.2, Mar. 1990   *
  5. ******************************************************************************
  6. * General definitions of/for GeoMat3D.c module                     *
  7. *****************************************************************************/
  8.  
  9. #ifndef    GEOMAT_3D_H
  10. #define GEOMAT_3D_H
  11.  
  12. /* Used by the Ray & Polygon intersection (Jordan theorem): */
  13. #define BELOW_RAY    1
  14. #define ON_RAY        2
  15. #define ABOVE_RAY    3
  16.  
  17. /* And prototypes of the functions: */
  18.  
  19. void MatGenUnitMat(MatrixType Mat);
  20. void MatGenMatTrans(RealType Tx, RealType Ty, RealType Tz, MatrixType Mat);
  21. void MatGenMatScale(RealType Sx, RealType Sy, RealType Sz, MatrixType Mat);
  22. void MatGenMatRotX1(RealType Teta, MatrixType Mat);
  23. void MatGenMatRotX(RealType CosTeta, RealType SinTeta, MatrixType Mat);
  24. void MatGenMatRotY1(RealType Teta, MatrixType Mat);
  25. void MatGenMatRotY(RealType CosTeta, RealType SinTeta, MatrixType Mat);
  26. void MatGenMatRotZ1(RealType Teta, MatrixType Mat);
  27. void MatGenMatRotZ(RealType CosTeta, RealType SinTeta, MatrixType Mat);
  28.  
  29. void MatMultTwo4by4(MatrixType MatRes, MatrixType Mat1, MatrixType Mat2);
  30. void MatAddTwo4by4(MatrixType MatRes, MatrixType Mat1, MatrixType Mat2);
  31. void MatSubTwo4by4(MatrixType MatRes, MatrixType Mat1, MatrixType Mat2);
  32. void MatScale4by4(MatrixType MatRes, MatrixType Mat, RealType *Scale);
  33.  
  34. void MatMultVecby4by4(VectorType VRes, VectorType Vec, MatrixType Mat);
  35.  
  36. int MatInverseMatrix(MatrixType M, MatrixType InvM);
  37.  
  38. void VecCopy(VectorType Vdst, VectorType Vsrc);
  39. void VecNormalize(VectorType V);
  40. RealType VecLength(VectorType V);
  41. void VecCrossProd(VectorType Vres, VectorType V1, VectorType V2);
  42. RealType VecDotProd(VectorType V1, VectorType V2);
  43.  
  44. ObjectStruct *GenMatObjectRotX(RealType *Degree);
  45. ObjectStruct *GenMatObjectRotY(RealType *Degree);
  46. ObjectStruct *GenMatObjectRotZ(RealType *Degree);
  47. ObjectStruct *GenMatObjectTrans(VectorType Vec);
  48. ObjectStruct *GenMatObjectScale(VectorType Vec);
  49. ObjectStruct *TransformObject(ObjectStruct *PObj, MatrixType Mat);
  50.  
  51. /* And the computational geometry routines: */
  52. RealType CGDistPointPoint(PointType P1, PointType P2);
  53. int CGPlaneFrom3Points(PlaneType Plane, PointType Pt1, PointType Pt2,
  54.                             PointType Pt3);
  55. void CGPointFromPointLine(PointType Point, PointType Pl, PointType Vl,
  56.                         PointType ClosestPoint);
  57. RealType CGDistPointLine(PointType Point, PointType Pl, PointType Vl);
  58. RealType CGDistPointPlane(PointType Point, RealType Plane[4]);
  59. int CGPointFromLinePlane(PointType Pl, PointType Vl, RealType Plane[4],
  60.                     PointType InterPoint, RealType *t);
  61. int CGPointFromLinePlane01(PointType Pl, PointType Vl, RealType Plane[4],
  62.                     PointType InterPoint, RealType *t);
  63. int CG2PointsFromLineLine(PointType Pl1, PointType Vl1,
  64.               PointType Pl2, PointType Vl2,
  65.               PointType Pt1, RealType *t1,
  66.               PointType Pt2, RealType *t2);
  67. RealType CGDistLineLine(PointType Pl1, PointType Vl1,
  68.             PointType Pl2, PointType Vl2);
  69.  
  70. int CGPolygonRayInter(PolygonStruct *Pl, PointType PtRay, int RayAxes);
  71. int CGPolygonRayInter3D(PolygonStruct *Pl, PointType PtRay, int RayAxes);
  72.  
  73. #endif    /* GEOMAT_3D_H */
  74.